<style>
</style>

<template>
    <div class="table">
        <Table border :columns="columns" :data="list"></Table>
        <Page :total="total_count" :page-size="limit" show-total show-elevator ></Page>
    </div>
</template>
<script>
import http from '../../libs/http';
export default {
    data () {
        return {
            list: [],
            limit: 15,
            total_count: 0,
            page: 1,
            keywords: '',
            columns: [
                {
                title: 'ID',
                key: 'id',
                align: 'center'
            },
            {
                title: '账户名',
                key: 'nickname',
                align: 'center'
            },
            {
                title: '所属角色组',
                key: 'role',
                align: 'center'
            },
            {
                title: '操作',
                key: 'action',
                align: 'center',
                render: (h, param) => {
                    return h('div', [
                        h('Button',{
                            props: {
                                type: 'primary',
                                size: 'small'
                            },
                            style: {
                                marginRight: '10px'
                            },
                            on: {
                                click: () => {
                                    this.edit(params.index)
                                }
                            }
                        }, '编辑'),
                        h('Button', {
                            props: {
                                type: 'error',
                                size: 'small'
                            },
                            on: {
                                click: () => {
                                    this.remove(params.index)
                                }
                            }
                        }, '删除')
                    ])
                }
            }
            ]
        }
    },
    methods: {
        getList () {
            var url = 'admin/users'
            this.apiGet(url).then((res) => {
                console.log(res);
            })
        }
    },
    created() {
        this.getList()
    },
    mixins: [http]
}
</script>
